package com.cx.dal.dao;

import com.cx.meta.dto.CxUser;
import com.cx.meta.model.po.UserQueryParams;
import com.cx.meta.model.vo.UserInfo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CxUserMapper {
    int deleteByPrimaryKey(String id);

    int insert(CxUser record);

    int insertSelective(CxUser record);

    CxUser selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(CxUser record);

    int updateByPrimaryKey(CxUser record);

    @Select("select * from cx_user")
    List<CxUser> selectAll();

    @Select("select * from cx_user where mobile_number = #{mobile}")
    CxUser selectByMobile(String mobile);

    @Select("select * from cx_user where username = #{loginName} or id_number = #{loginName} or mobile_number = #{loginName}")
    CxUser selectByLoginName(String loginName);

    Page<UserInfo> getByParams(UserQueryParams params);

}